<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/common/commonConfig.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>

<head>
    <base href="<%=basePath%>">
    <title>选择工作站</title>
	<script src="<%=basePath%>component/grid.js"></script>
	<script type="text/javascript">
	var mygrid;
	
	var dhxGrid = {
		initDataTable : function () {
			mygrid = createGridNormal('tableGridContainer');
		    mygrid.setHeader("序号,工作站名称,工作站地址,备注");
		    mygrid.setInitWidths("50,150,150,*");
		    mygrid.setColAlign("right,left,left,left");
		    mygrid.setColSorting("int,str,str,str");
		    mygrid.setColTypes("ro,ro,ro,ro");
		    mygrid.attachEvent("onRowDblClicked",this.chooseWorksiteInfo);
		    mygrid.attachEvent("onEnter",this.chooseWorksiteInfo);
		    mygrid.init();
		    setSkin(mygrid);
		    mygrid.loadXML('<%=basePath%>system-worksite/WorksiteAction!worksiteGrid.action');
		},
		chooseWorksiteInfo : function (rowID,celInd){
			var name = mygrid.cells(rowID,1).getValue();
			chooseOne(rowID,name);
		}
	};
	
	function chooseOne(id, name){
		parent.document.getElementById('tunit.worksiteId').value = id;
		parent.document.getElementById('showWorksiteName').value = name;
	}
	
	$(function (){
	 	dhxGrid.initDataTable();
	});
	</script>
</head>
  
<body>
	<div id="tableGridContainer" style="width:100%;height:100%;"></div>
</body>

</html>
